In an image forming apparatus, if the environment such as temperature changes greatly, the probability of an occurrence of failure becomes high. For this reason, by arranging a sensor such as a thermometer in the image forming apparatus, an operation corresponding to the change in the environment is executed. However, if a power supply of the image forming apparatus is turned off, the sensor cannot perform measurement. In the meantime, if the environment changes greatly, the image forming apparatus cannot perform operations corresponding to the change in the environment.